<!DOCTYPE html>
<html lang="en">


<script src="js/jquery-1.12.4.js"></script>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>个人信息</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <!--<link href="css/nprogress.css" rel="stylesheet">-->

    <!-- Custom Theme Style -->
    <link href="css/custom.min.css" rel="stylesheet">
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div id="head">
         </div>

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_content">
                    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->


                    <div class="m_des">
                      <table border="0" style="width:870px; line-height:22px;" cellspacing="0" cellpadding="0">
                        <tr valign="top">
                          <td width="115"><img src="images/user.png" width="90" height="90" class="IMAGELOCPATH" /></td>
                          <td>
                            <div class="m_user">用户名：<span id="username"></span></div>
                          </td>
                        </tr>
                      </table>
                    </div>
                    <form action="" method="post">
                      <div class="mem_t">账号信息</div>
                      <table border="0" class="mon_tab" style="width:870px; margin-bottom:20px;" cellspacing="0" cellpadding="0">
                        <tr>
                          <!--用户排名：用户id-->
                          <td width="60%">真实姓名：<span style="color:#555555;" id="realname"></span></td>
                        </tr>
                        <tr>
                          <td>电&nbsp; &nbsp; 话：<span style="color:#555555;" id="phone"></span></td>
                          <td>邮&nbsp; &nbsp; 箱：<span style="color:#555555;" id="email"></span></td>
                        </tr>
                        <tr>
                          <td>身份证号：<span style="color:#555555;" id="idcard"></span></td>
                          <!--<c:if test="${userList.type ==1}">-->

                            <!--<td>用户类型：<span style="color:#555555;">管理员</span></td>-->
                          <!--</c:if>-->
                          <!--<c:if test="${userList.type ==0}">-->
                            <td>用户类型：
                              <span style="color:#555555;" id="usertype"></span>
                            </td>
                          <!--</c:if>-->
                        </tr>
                        <tr>
                          <td>地&nbsp; &nbsp; 址：<span style="color:#555555;" id="address"></span></td>
                        </tr>
                        <tr>
                          <td>
                            <input type="hidden" value="flag" name="flag"/>
                             <a href="updatePersonalInfor.html"><input type="button" value="修改"/></a> </td>
                        </tr>

                      </table>
                  </form>

                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>

          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="js/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="js/fastclick.js"></script>
    <!-- NProgress -->
    <!--<script src="js/nprogress.js"></script>-->
    <!-- validator -->
    <script src="js/validator.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="js/custom.min.js"></script>

    <!-- validator -->
    <script>
      // initialize the validator function
      validator.message.date = 'not a real date';

      // validate a field on "blur" event, a 'select' on 'change' event & a '.reuired' classed multifield on 'keyup':
      $('form')
        .on('blur', 'input[required], input.optional, select.required', validator.checkField)
        .on('change', 'select.required', validator.checkField)
        .on('keypress', 'input[required][pattern]', validator.keypress);

      $('.multi.required').on('keyup blur', 'input', function() {
        validator.checkField.apply($(this).siblings().last()[0]);
      });

      $('form').submit(function(e) {
        e.preventDefault();
        var submit = true;

        // evaluate the form using generic validaing
        if (!validator.checkAll($(this))) {
          submit = false;
        }

        if (submit)
          this.submit();

        return false;
      });
    </script>
    <!-- /validator -->

    <!-- jQuery Smart Wizard -->
    <script>
      $(document).ready(function() {
        $("#head").load("head.html");
        $('.buttonNext').addClass('btn btn-success');
        $('.buttonPrevious').addClass('btn btn-primary');
        $('.buttonFinish').addClass('btn btn-default');
      });

      var $token=window.sessionStorage.getItem('token');
      $.ajax({
          url: "http://localhost:8081/userInfo/toUser",
          dataType: "json",
          type: "post",
          data: {"token": $token},
          xhrFields: {withCredentials: true},
          success: function (data) {
              $("#username").html(data.username);
              $("#phone").html(data.phone);
              if (data.imagpath != null && data.imagpath != '') {
                  $(".IMAGELOCPATH").attr("src", data.imagpath);
              } else if (data.imagpath2 != null && data.imagpath2 != '') {
                  $(".IMAGELOCPATH").attr("src", data.imagpath2);
              }
              if (data.sName != null && data.sName != '') {
                  $("#realname").html(data.sName);
              }else if (data.cUsername != null && data.cUsername != '') {
                  $("#realname").html(data.cUsername);
              }
              if (data.sEmail != null && data.sEmail != '') {
                  $("#email").html(data.sEmail);
              }else if (data.cEmail != null && data.cEmail != '') {
                  $("#email").html(data.cEmail);
              }
              if (data.sAddress != null && data.sAddress != '') {
                  $("#address").html(data.sAddress);
              }else if (data.cAddress != null && data.cAddress != '') {
                  $("#address").html(data.cAddress);
              }
              if (data.sIdcard != null && data.sIdcard != '') {
                  $("#idcard").html(data.sIdcard);
              }else if (data.idcard != null && data.idcard != '') {
                  $("#idcard").html(data.idcard);
              }
              $("#usertype").html(data.typename);

          },
          error:function () {
              alert("加载用户信息错误");
          }
      })
    </script>
    <!-- /jQuery Smart Wizard -->
  </body>
</html>
